package structure_pattern.observer_pattern;

/**
 * @author Feili
 * @since 2022/6/9 17:51
 */
public class StockNoticeControlCenter extends NoticeControlCenter{

    public StockNoticeControlCenter(Stock stock) {
        this.stock = stock;
    }

    @Override
    public void notifyUser() {
        if (5 <= this.getStock().getPrice()) {
            for(User user : userArrayList) {
                user.notice(stock.getPrice());
            }
        }
    }
}